<?php

$block = $this->block;
$columns = (int)$block->params['columns'];

?>
<ul>
<?php
for ($i = 0, $bannersCount = count($this->banners); $i < $bannersCount; ++$i) {
	$banner = $this->banners[$i];
	if ($i > 0 && ($i % $columns) == 0) {
?>
</ul>
<ul>
<?php
	}
	if ('' != $banner->customCode) {
		echo $banner->customCode, "\n";
	} else {
?>
	<li class="banner <?php echo (($i % $columns) == 0 ? ' first' : ''), ((($i - 1) % $columns) == 0 ? ' last' : '') ?>"><a
		target="_blank" href="/Blackbird/banners/click/slug/<?php echo $this->escape($banner->slug) ?>"><img
		alt="<?php echo $this->escape($banner->name) ?>" border="0" src="<?php echo $this->escape($banner->image) ?>"/></a></li>
<?php
	}
}
?>
</ul>
